package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;

	public class PaintSettings implements RemedyDataObject
	{
		public var bgColor:int;
		public var h:int;
		public var name:String;
		public var w:int;

		public function PaintSettings(bgColor:int = 0, h:int = 0, name:String = null, w:int = 0)
		{
			this.bgColor = bgColor;
			this.h = h;
			this.name = name;
			this.w = w;
		}

		public function writeWithGraph(connection:RemedyClientServerConnection, graph:Vector.<Object>):void
		{
			RemedyCodec.writeClassID(connection.getSocket(), 74);
			RemedyIntegerClassManager.INSTANCE.writeWithGraph(bgColor, connection, graph);
			RemedyIntegerClassManager.INSTANCE.writeWithGraph(h, connection, graph);
			RemedyStringClassManager.INSTANCE.writeWithGraph(name, connection, graph);
			RemedyIntegerClassManager.INSTANCE.writeWithGraph(w, connection, graph);
		}

		public static function readWithGraph(connection:RemedyClientServerConnection, graph:Vector.<Object>):Object
		{
			var bgColor:int = (int)(RemedyIntegerClassManager.INSTANCE.readWithGraph(connection, graph));
			var h:int = (int)(RemedyIntegerClassManager.INSTANCE.readWithGraph(connection, graph));
			var name:String = (String)(RemedyStringClassManager.INSTANCE.readWithGraph(connection, graph));
			var w:int = (int)(RemedyIntegerClassManager.INSTANCE.readWithGraph(connection, graph));
			var ret:PaintSettings = new PaintSettings(bgColor, h, name, w);
			return ret;
		}
	}
}
